package br.com.vpsa.previdordevendas.model.component;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
public class ZerarDadosComponent {

    @PersistenceContext
    private EntityManager em;

	@Transactional
	public void zerar(){
		
		em.createQuery("delete from FaturamentoMensal").executeUpdate();
		em.createQuery("delete from HistoricoConsolidacao").executeUpdate();
		em.createQuery("delete from Inflacao").executeUpdate();
		em.createQuery("delete from JsonPedidos").executeUpdate();
		em.createQuery("delete from Pedido").executeUpdate();
		em.createQuery("delete from PrevisaoManual").executeUpdate();
		
	}
	
}
